home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / flilib.zip / AASCREEN.H < prev    next >
C/C++ Source or Header  |  1993-02-09  |  2KB  |  60 lines

  1. /* aascreen.h  Copyright 1990 Dancing Flame, San Francisco */
  2.  
  3. #ifndef AASCREEN_H
  4. #define AASCREEN_H
  5.  
  6. #ifndef AATYPES_H
  7. #include "aatypes.h"
  8. #endif /* AATYPES_H */
  9.  
  10.  
  11. /* Graphics types */
  12. typedef unsigned char Cmap;
  13. typedef unsigned char Pixel;
  14. typedef unsigned char Bitplane;
  15.  
  16. /* Constants pertaining to 320x200 256 color mode mostly */
  17. #define AA_VGA_SCREEN ((Pixel *)0xa0000000)
  18. #define AA_XMAX 320
  19. #define AA_YMAX 200
  20. #define AA_BPR 320
  21. #define AA_COLORS 256
  22.  
  23. /* This structure is something we can draw on.  A superset of Vcel
  24.    (and keep it that way or things break!)  */
  25. struct vscreen
  26.     {
  27.     int x, y;    /* upper left corner in screen coordinates */
  28.     unsigned w, h;    /* width, height */
  29.     unsigned bpr;    /* bytes per row of image p */
  30.     Pixel *p;    /* Starts on segment boundary */
  31.     Cmap *cmap;
  32.     long psize;    /* size of pixels */
  33.     Pixel *allocedp;    /* for memory based screens only */
  34.     };
  35. typedef struct vscreen Vscreen;
  36. extern Vscreen aa_screen;
  37. extern Cmap aa_colors[];    /* software echo of color map */
  38. Boolean aa_open_vga_screen(void);    /* opens 256 color screen */
  39. void aa_close_vga_screen(void);
  40. /* Open a screen can draw on but not see */
  41. Vscreen *aa_alloc_mem_screen(void);    
  42. /* For screens not full size */
  43. Vscreen *aa_alloc_mem_cel(int x, int y, int w, int h); 
  44. void aa_free_mem_screen(Vscreen *ms);    /* dispose of a memory screen */
  45. void aa_copy_screen(Vscreen *source, Vscreen *dest);
  46. void aa_clear_screen(Vscreen *vs);
  47.  
  48. /* Get the current video mode */
  49. int dos_get_vmode(void);
  50. /* Set video mode.  Mode 0x13 is 320x200 256 color */
  51. void dos_set_vmode(int mode);
  52. /* Set the VGA color map. */
  53. void aa_set_colors(int start, int count, Cmap *cmap);    
  54. /* Wait until in vertical blank */
  55. void aa_wait_vblank(void);
  56. /* Wait until out of vertical blank */
  57. void aa_wait_no_vblank(void);
  58.  
  59. #endif /* AASCREEN_H */
  60.